home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr52
/
expand53.zip
/
XPDEMO.ZIP
/
XPDISK.PRG
< prev
next >
Wrap
Text File
|
1992-08-07
|
3KB
|
98 lines
* ------------------------------------------------------------------------
* Module......: XPDISK.PRG
* Title.......: DISK part of the Expand Library Demonstration Program
* Author......: Pepijn Smits.
* Date........: July/August 1992
* Copyright...: (c)1992 by Softwarebureau Pepijn Smits
* Notes.......: Clipper 5.01 Demo of the Expand Library
* Some general DISK functions
* See XPDEMO.RMK For Compile and Link instructions.
* ------------------------------------------------------------------------
Function ChangeDrive()
Local i
Local DriveMenu := {}
Local colon := if(XPlastDisk()<14,':','')
For i := 0 to XPlastdisk()
aAdd(DriveMenu, if(i=XPgetDisk(),'~','')+Chr(65+i)+colon)
Next
i := XPalert('Select Drive','Select the New ~default~ drive',DriveMenu,XPgetDisk()+1)
if i != 0
/* We're changing the Drive.. */
if XPDOSvalue() >= 3.20
/* Check for Logical drive acces if DOS 3.20 + */
if XPGetDrive(i) <> 0
if XPGetDrive(i) <> i
XPalert('Drive Select','Physical drive was not ~last~ accessed as this drive;'+;
'Enter Disk for Drive ~'+Chr(64+i)+':')
XPsetDrive(i) /* Set the drive as Being last accessed */
end
end
end
XPsetDisk(i-1) /* select Default Disk */
if XPgetDisk() <> i-1
XPalert('Invalid Drive','Sorry, It seems that drive ~'+chr(64+i)+':~ is invalid..')
end
end
Return (NIL)
Function DiskStatus()
XPalert('Disk Status',;
PadR("Current drive : ~" + Chr(XPgetDisk()+65)+':',60)+";"+;
PadR("Qualified Path : ~" + XPqualify('.'),60)+";"+;
PadR("Free disk space : ~" + Str(DiskSpace(),10)+" Bytes.",60)+";"+;
PadR("Total disk space : ~" + Str(XPdiskTotal(),10)+" Bytes.",60)+";"+;
PadR("Disk Fixed? : ~" + iif(XPdiskFixed(),'Yes.','No. '),60)+";"+;
PadR("Disk Remote? : ~" + iif(XPdiskRemote(),'Yes.','No. '),60)+";"+;
PadR("Valid drives are : ~A: - " + Chr( XPlastDisk() + 65 )+':',60)+";"+;
PadR("Used/Avail Handles : ~" + nTrim(XPgetHandles()) + "/" + nTrim(XPmaxHandles()),60))
Return (NIL)
Function DirTree()
Local aTree := {}
Local x, i := 1
XPpop(' ~Directory~ Tree',' ; Scanning the Disk For directories;;;;Please Wait..;')
i := 1
XPdirTree("\",{|t,s|aAdd(aTree,' '+t),XPcenter(XPmidRow(),nTrim(i++))})
XPmsg(' ~Dir~ Tree │ No directory change will take place, simply browse..')
XPbrowse(' Directory ~Tree~ of Drive '+Chr(XPgetDisk()+65)+': ',' Graphical ~directory~ tree:',aTree)
Return (NIL)
Function FileFind()
Local cMask := Prompt("~File~ Find","Enter Mask of file(s) to find:","*.DBF")
Local aFiles := {}
Local x, i := 1
XPpop(' ~File~ Find',' ; Scanning the Disk For Files matching ~'+cMask+'~;;0;;File(s) Found, Please Wait..(Scanning);')
i := 1
XPfileFind("\",cMask,;
{|e|aAdd(aFiles,' '+Padr(e[1],45)+' '+Str(e[2],9)+' '+DtoC(e[3])+' '+e[4]),;
XPcenter(XPmidRow(),nTrim(i++))})
XPmsg(' ~File~ Find │ Here are the Files Found....')
if Len(aFiles)>0
XPbrowse(' ~File~ Find ',;
' File: Size: Date: Time:',;
aFiles)
else
XPalert('~File~ Find','Sorry, no files Found matching ~'+cMask+'~..')
end
Return (NIL)
Function TempFile()
XPalert("Sorry",'The Routines for the ~TempFile~ testing have not yet been;written and tested..')
// Beta tester: Please try it in your Network if you can test them there....
Return (NIL)